<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/favicon.ico">
    <link rel="canonical" href="https://getbootstrap.com/docs/3.4/examples/jumbotron/">

    <title>大伟涨粉</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/dist/css/bootstrap.min.css"
          rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/assets/css/ie10-viewport-bug-workaround.css"
          rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/examples/jumbotron/jumbotron.css"
          rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]>
    <script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/assets/js/ie8-responsive-file-warning.js"></script>
    <![endif]-->
    <script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">伟哥涨粉</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse" >
            <div class="navbar-form navbar-right" >
                <a style="color: white;font-size: 18px;" id="userNameId2" ></a>
                <div class="form-group " id="userNameId">
                    <input type="text" placeholder="用户名" name="loginusername" class="form-control">
                </div>
                <div class="form-group" id="passwordId">
                    <input type="password" placeholder="密码" name="loginpassword" class="form-control">
                </div>
                <button type="submit" id="btnlogin" class="btn btn-success loginId">登录</button>
                <button type="submit" class="btn btn-success loginId" data-toggle="modal" data-target="#myModal" id="regId">注册</button>
            </div>
        </div><!--/.navbar-collapse -->
    </div>
</nav>

<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
    <div class="container">
        <h2>须知</h2>
        <p>本网站专业涨粉辅助，如有需要请拍以下商品，拍后请联系管理员</p>
        <!--<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more »</a></p>-->
    </div>
</div>

<div class="container">
    <!-- Example row of columns -->
    <div class="row">
        <div class="col-md-4">
            <h2>普通用户</h2>
            <h3>￥0</h3>
            <p>原价购买商品，不能发展下线</p>
            <button type="button" id="putong" class="btn btn-success"  data-toggle="modal" data-target="#putongmyModal">我要充值</button>
        </div>
        <div class="col-md-4">
            <h2>白银会员</h2>
            <h3>￥100</h3>
            <p>购买商品低至9折，1个下线名额 </p>
            <button type="button" id="putong2" class="btn btn-success"  data-toggle="modal" data-target="#putongmyModal">我要充值</button>
        </div>
        <div class="col-md-4">
            <h2>黄金会员</h2>
            <h3>￥500</h3>
            <p>购买商品低至8折，3个下线名额</p>
            <button type="button" id="putong3" class="btn btn-success"  data-toggle="modal" data-target="#putongmyModal">我要充值</button>
        </div>
    </div>

    <hr>

    <footer>
        <p>© 相信专业的力量，我叫张伟.</p>
    </footer>
</div> <!-- /container -->
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="top: 26%;">
        <div class="modal-content">
            <div class="modal-body">
                <form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">用户名</label>
                        <div class="col-sm-10">
                            <input type="text" name="username" class="form-control" id="firstname" placeholder="请输入用户名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10">
                            <input type="text" name="email" class="form-control" id="email" placeholder="请输入邮箱">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="password" class="col-sm-2 control-label">密码</label>
                        <div class="col-sm-10">
                            <input type="password" name="password" class="form-control" id="password" placeholder="请输入密码">
                        </div>
                    </div>
                    <button class="btn btn-success btn-block" id="btnSubmit" data-loading="正在验证注册，请稍候...">注册</button>
                </form>

            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- 模态框（Modal） -->
<div class="modal fade" id="putongmyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="top: 26%;">
        <div class="modal-content">
            <div class="modal-body">
                <!--<form class="form-horizontal" role="form">
                    <div class="form-group">
                        <label for="firstname" class="col-sm-2 control-label">用户名</label>
                        <div class="col-sm-10">
                            <input type="text" name="username" class="form-control" id="firstname" placeholder="请输入用户名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10">
                            <input type="text" name="email" class="form-control" id="email" placeholder="请输入邮箱">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="password" class="col-sm-2 control-label">密码</label>
                        <div class="col-sm-10">
                            <input type="password" name="password" class="form-control" id="password" placeholder="请输入密码">
                        </div>
                    </div>
                    <button class="btn btn-success btn-block" id="btnSubmit" data-loading="正在验证注册，请稍候...">注册</button>
                </form>-->
                <form class="form-horizontal" role="form">
                    <!--<div class="panel panel-primary">
                        <div class="panel-heading">
                            请加QQ好友详细咨询
                        </div>
                        <div class="panel-body">
                            <p>QQ：321456456</p>
                        </div>
                    </div>-->
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            请加QQ好友详细咨询
                        </div>
                        <div class="panel-body">
                            <p>QQ：321456456</p>
                        </div>
                    </div>
                </form>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ"
        crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/dist/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="https://cdn.jsdelivr.net/npm/@bootcss/v3.bootcss.com@1.0.18/assets/js/ie10-viewport-bug-workaround.js"></script>
<script th:inline="javascript"> var ctx = [[@{/}]]; var captchaType = [[${captchaType}]]; </script>
<script src="../static/ajax/libs/validate/jquery.validate.min.js" th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../static/ajax/libs/blockUI/jquery.blockUI.js" th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="../static/ruoyi/js/ry-ui.js" th:src="@{/ruoyi/js/ry-ui.js?v=4.7.0}"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#btnSubmit").click(function(){
            register();
        });
        $("#btnlogin").click(function(){
            login();
        });

        /*$("#putong").click(function(){
            login();
        });*/


        function register() {
            $.modal.loading($("#btnSubmit").data("loading"));
            var username = $.common.trim($("input[name='username']").val());
            var password = $.common.trim($("input[name='password']").val());
            var email = $.common.trim($("input[name='email']").val());
            var validateCode = $("input[name='validateCode']").val();
            $.ajax({
                type: "post",
                url: ctx + "register_weige",
                data: {
                    "loginName": username,
                    "password": password,
                    "email":email,
                    "validateCode": validateCode
                },
                success: function(r) {
                    if (r.code == web_status.SUCCESS) {
                        layer.alert("<font color='red'>恭喜你，您的账号 " + username + " 注册成功！</font>", {
                                icon: 1,
                                title: "系统提示"
                            },
                            function(index) {
                                //关闭弹窗
                                layer.close(index);
                                location.href = ctx + 'login';
                            });
                    } else {
                        $.modal.closeLoading();
                        $('.imgcode').click();
                        $(".code").val("");
                        $.modal.msg(r.msg);
                    }
                }
            });
        }

        function login() {
            //$.modal.loading($("#btnlogin").data("loading"));
            var username = $.common.trim($("input[name='loginusername']").val());
            var password = $.common.trim($("input[name='loginpassword']").val());
            $.ajax({
                type: "post",
                url: ctx + "login_weige",
                data: {
                    "username": username,
                    "password": password,
                    "rememberMe": "true"
                },
                success: function(r) {
                    debugger
                    if (r=="success") {
                        $("#userNameId").css('display','none');
                        $("#passwordId").css('display','none');
                        $("#btnlogin").css('display','none');
                        $("#regId").css('display','none');
                        $("#userNameId2").text($("*[name='loginusername']").val())
                        /*<span style="color: white;">若依</span>*/
                        //location.href = ctx + 'index';
                    } else {
                        $.modal.closeLoading();
                        $('.imgcode').click();
                        $(".code").val("cuo");
                        $.modal.msg("用户名密码错误");
                    }
                }
            });
        }
    });
</script>
</body>
</html>


